#js-authenticate-u2f

%script#js-authenticate-u2f-not-supported{ type: "text/template" }
  %p Your browser doesn't support U2F. Please use Google Chrome desktop (version 41 or newer).

%script#js-authenticate-u2f-setup{ type: "text/template" }
  %div
    %p Insert your security key (if you haven't already), and press the button below.
    %a.btn.btn-info#js-login-u2f-device{ href: 'javascript:void(0)' } Login Via U2F Device

%script#js-authenticate-u2f-in-progress{ type: "text/template" }
  %p Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now.

%script#js-authenticate-u2f-error{ type: "text/template" }
  %div
    %p <%= error_message %>
    %a.btn.btn-warning#js-u2f-try-again Try again?

%script#js-authenticate-u2f-authenticated{ type: "text/template" }
  %div
    %p We heard back from your U2F device. Click this button to authenticate with the GitLab server.
    = form_tag(new_user_session_path, method: :post) do |f|
      = hidden_field_tag 'user[device_response]', nil, class: 'form-control', required: true, id: "js-device-response"
      = submit_tag "Authenticate via U2F Device", class: "btn btn-success"

:javascript
  var u2fAuthenticate = new U2FAuthenticate($("#js-authenticate-u2f"), gon.u2f);
  u2fAuthenticate.start();
